
##Takes current model and produces a simulation run with the specified paramterers and 
##run length
#models should now have this syntax: AR_coeffs;d;MA_coeffs;alpha_coeffs;beta_coeffs;uncond.mean;uncond.variance;outliers;distn
#each ";" delimited item is an order-ascending list of parameters
options(warn=-1)
"auto.sim" = function(current.model, n){	
   temp = as.matrix(unlist(strsplit(as.character(current.model),";")))
   phis = as.numeric(unlist(strsplit(temp[1],",")));
   d = as.numeric(unlist(strsplit(temp[2],",")));
   thetas = as.numeric(unlist(strsplit(temp[3],",")));
   alphas = as.numeric(unlist(strsplit(temp[4],",")));
   betas = as.numeric(unlist(strsplit(temp[5],",")));
   mu = as.numeric(unlist(strsplit(temp[6],",")));
   omega = as.numeric(unlist(strsplit(temp[7],",")));
   outliers = as.numeric(unlist(strsplit(temp[8],",")));
   cond.distn = as.character(unlist(strsplit(temp[9],",")));

   sim.values = arma.garch.sim(phis,d,thetas,mu,alphas,betas,omega,n,outliers, cond.distn)$sim.values;
   return(structure(list(sim.values = sim.values)));
}

